﻿using System.Collections.Generic;

namespace Fast.Extensions.DatabaseAccessor.EntityFrameworkCore
{
    /// <summary>
    /// 分页结果Dto
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagedList<TEntity>
        where TEntity : new()
    {
        /// <summary>
        /// 当前页的集合
        /// </summary>
        public IReadOnlyList<TEntity> Items { get; set; } = new List<TEntity>();

        /// <summary>
        /// 总记录数
        /// </summary>
        public long TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 页容量
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 是否有上一页
        /// </summary>
        public bool HasPrevPages { get; set; }

        /// <summary>
        /// 是否有下一页
        /// </summary>
        public bool HasNextPages { get; set; }
    }
}
